Skip to content

fix(openapi): dataset 改自由字串,解除 GPT 只能查 17 個 dataset 的限制#8

Open
linsamtw wants to merge 1 commit into
masterfrom
fix/openapi-dataset-free-string
Open

fix(openapi): dataset 改自由字串,解除 GPT 只能查 17 個 dataset 的限制#8
linsamtw wants to merge 1 commit into
masterfrom
fix/openapi-dataset-free-string

Conversation

@linsamtw
Copy link
Copy Markdown
Contributor

@linsamtw linsamtw commented Jun 1, 2026

問題

chatgpt/openapi.yamlqueryDatasetdataset 參數寫死成只有 17 個enum。ChatGPT 把 enum 當白名單驗證 → Custom GPT 實際上只能查這 17 個

但 FinMind 走 /api/v4/data 的 dataset 有 87 個knowledge/datasets.md 共 90,其中 3 個走專屬 endpoint)。knowledge bundle 已完整列出 90 個含必填參數/會員層級,GPT「知道」卻被 action 擋住。這個 17-enum 是早期 MVP 的殘留,與已擴充到 90 的知識包 drift。

修正

移除 datasetenum,改為自由字串(仍 required),描述指向 knowledge bundle、要求只用 bundle 列出的名稱、不要自行編造。

  • 87 個 /data dataset 全可查
  • 未來新增 dataset 不需再改 openapi(零同步維護)

範圍

  • MCP server 的 query_dataset 工具本來就是自由字串、無此限制,故此修正僅動 chatgpt/openapi.yaml(GPT-only)。
  • 3 個專屬 endpoint dataset(分點進出 / secid_agg / 權證分點)仍未提供對應 action,不在本次範圍(之後要的話另開)。

驗證

  • openapi 解析通過(dataset 無 enum、type=stringrequired
  • 32 passedbuild_instructions 7986/8000

套用到 GPT

merge 後,把更新版 chatgpt/openapi.yaml 重貼進 GPT Action 的結構描述即可(schema 變更不影響 PyPI / MCP)。

🤖 Generated with Claude Code

問題:chatgpt/openapi.yaml 的 queryDataset,dataset 參數寫死成只有 17 個的
enum。ChatGPT 把 enum 當白名單驗證,導致 Custom GPT 實際上只能查這 17 個,
但 FinMind 走 /api/v4/data 的 dataset 有 87 個(datasets.md 共 90,其中 3 個
走專屬 endpoint)。knowledge bundle 已完整列出 90 個含參數/層級,GPT「知道」
卻被 action 擋住。enum 是早期 17 MVP 的殘留,與已擴充到 90 的知識包 drift。

修正:移除 dataset 的 enum,改為自由字串(仍 required),描述指向 knowledge
bundle、要求只用 bundle 列出的名稱。87 個 /data dataset 全可查、未來新增
dataset 不需再改 openapi。

註:MCP server 的 query_dataset 工具本來就是自由字串、無此限制,故此修正
僅動 chatgpt/openapi.yaml(GPT-only)。3 個專屬 endpoint dataset 仍未提供
對應 action,本次不在範圍。

驗證:openapi 解析通過(dataset 無 enum、type=string、required)、32 tests
passed、build_instructions 7986/8000。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant